<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <title>修改密码</title>
    <link rel="stylesheet" href="../../css/amazeui.min.css">
    <link rel="stylesheet" href="css/app.css">
    <style>
    	body{
    		
    	}
    </style>
</head>
<body>


<div id='header' class="am-g am-topbar-fixed-top" >
	<div  onclick="api.closeWin();"  class="am-u-sm-2" style="margin-top:12px;padding-left: 17px">
		<img  src="images/arr-l.png" style="height:14px;height: 18px;"/>
	</div> 
	<div class="am-u-sm-8 til" style="margin-top:13px;text-align:center;">
		<h1>修改密码</h1>
	</div>
	<div class="am-u-sm-2" style="font-size: 20px;margin-top:10px;color:white;text-align:center;">

   </div>
</div>



<div class="am-g" style="margin-top:60px">

	<div class="am-u-sm-12">
	    <input type="password" class="am-form-field borderradius"   id="oldPass"  placeholder="请输入原密码" />
	</div>
	
	<div class="am-u-sm-12"  style="margin-top:15px;">
	    <input type="password" class="am-form-field borderradius"  id="newPass" placeholder="请输入新密码" />
	</div>
	
	<div class="am-u-sm-12"  style="margin-top:15px;">
	    <input type="password" class="am-form-field borderradius"  id="newPass2" placeholder="请再次输入新密码" />
	</div>
	
	<div class="am-u-sm-12"  onclick='resetPwd();' style="margin-top:15px;">
	   <div class="am-u-sm-12 bottonradius">
		            提交
	    </div>
	</div>

</div>




	
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
    
    var member=$api.getStorage('member');
	apiready = function(){
	     
	
		
	};
	
	//修改密码
	function resetPwd(){
	    var account=$api.getStorage('account');
	    var oldpwd=$api.byId('oldPass').value;
	    var password1=$api.byId('newPass').value;
	    var password2=$api.byId('newPass2').value;
	    
	    if(oldpwd==''||password1==''||password2==''){
	        toast('请输入密码!');
	        return;
	    }
	    
	    if(password1!=password2){
	         toast('新密码不一致!');
	         return;
	    }
	    
	    var data={
	        'account' :account,
    	    'newpwd' :password2,
    	    'oldpwd' :oldpwd,
	    };
	    
	    do_ajax("/app/member/resetpwd",'post',data,function(result,err){
			api.hideProgress();
		
			if(result.resultCode == '0') {
			    toast('修改成功!');
			    setTimeout(function () {
	 			    api.closeWin();
	            }, 2000);
	 			
	 		}else{
	 			 toast(result.datas);
	 		}
	 	});
	    
	
	};
	
</script>
</html>